package cn.com.huzo.webapp.controller.master;

import huzofw.common.web.controller.BaseFormController;
import cn.com.huzo.service.master.CustomerSizeLableManager;
import java.util.Map;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 客户尺码标号管理控制器
 *
 * @author 吴旭
 */
@Controller
@RequestMapping(value = "/master/customer/size_lable")
public class CustomerSizeLableController extends BaseFormController {

    // <editor-fold defaultstate="collapsed" desc="属性">
    @Resource(name = "CustomerSizeLableManager")
    private CustomerSizeLableManager _manager;
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="客户尺码标号数据处理部分">
    /**
     * 根据条件取得客户尺码标号分页数据。
     * <p>
     * @param criterion 检索条件
     * @return 客户组成员分页数据
     * @throws Exception
     */
    @RequestMapping(value = "/fetchForPage.html",
            method = RequestMethod.POST)
    public @ResponseBody
    Map<String, Object> fetchForPage(@RequestBody final Map<String, Object> criterion) throws Exception {
        return _manager.fetchForPage(criterion);
    }

    /**
     * 导入尺码数据到客户尺码标号
     *
     * @param criterion 要处理的数据列表
     * @return
     *
     * @throws java.lang.Exception
     */
    @RequestMapping(value = "/import.html",
            method = RequestMethod.POST)
    public @ResponseBody
    Map<String, Object> importFromSize(@RequestBody final Map<String, Object> criterion) throws Exception {
        return _manager.importFromSize(criterion);
    }

    /**
     * 拷贝其他客户尺码标号
     *
     * @param criterion 要处理的数据列表
     * @return
     *
     * @throws java.lang.Exception
     */
    @RequestMapping(value = "/copy.html",
            method = RequestMethod.POST)
    public @ResponseBody
    Map<String, Object> copyFromOtherSizeLable(@RequestBody final Map<String, Object> criterion) throws Exception {
        return _manager.copyFromOtherSizeLable(criterion);
    }

    /**
     * 批量修改客户尺码标号
     *
     * @param criterion 要处理的数据列表
     * @return
     *
     * @throws java.lang.Exception
     */
    @RequestMapping(value = "/update.html",
            method = RequestMethod.POST)
    public @ResponseBody
    Map<String, Object> batchUpdate(@RequestBody final Map<String, Object> criterion) throws Exception {
        return _manager.batchUpdate(criterion);
    }

    /**
     * 删除
     *
     * @param criterion 删除条件
     * @return 影响行数
     * @throws java.lang.Exception
     */
    @RequestMapping(value = "/delete.html",
            method = RequestMethod.POST)
    public @ResponseBody
    Map<String, Object> deleteLines(@RequestBody final Map<String, Object> criterion) throws Exception {
        return _manager.delete(criterion);
    }

    /**
     * 批量删除
     *
     * @param criterion 要删除的成员
     * @return 影响行数
     * @throws java.lang.Exception
     */
    @RequestMapping(value = "/batch_delete.html",
            method = RequestMethod.POST)
    public @ResponseBody
    Map<String, Object> batchDelete(@RequestBody final Map<String, Object> criterion) throws Exception {
        return _manager.batchDelete(criterion);
    }
    // </editor-fold>
}
